from flask import Flask
from flask import request
from flask import render_template

app = Flask(__name__)


@app.route('/', methods=['GET', 'POST'])
def home():
    return render_template('home.html')


@app.route('/login', methods=['GET'])
def login():
    return '''<form action="/signIn" method="post">
              <p><input name="username"></p>
              <p><input name="password" type="password"></p>
              <p><button type="submit">Sign in</p>
              </form>'''


@app.route('/signIn', methods=['POST'])
def signIn():
    if request.form['username'] == 'admin' \
            and request.form['password'] == '123456':
        return '<h3>hello,admin</h3>'
    return '<h3>bad enter error username or password</h3>'


if __name__ == '__main__':
    app.run()
